package com.bruan.annotation;

import org.junit.Test;

public class AnnotationTest3 {
    @Test
    public void parseClass(){
        //解析注解 先得到类对象
        Class<Demo> demoClass = Demo.class;
        //解析类上注解
        //判断类上是否包含注解
        if (demoClass.isAnnotationPresent(MyTest2.class)){
            //获取注解对象
            MyTest2 annotation = demoClass.getDeclaredAnnotation(MyTest2.class);
            System.out.println(annotation.aaa());
            System.out.println(annotation.value());
            System.out.println(annotation.bbb());
        }
    }
}
